#pragma once

#include "Rect.h"

class XmlNode;

enum GUIType
{
	TEXT_GUI,
	IMAGE_GUI,
	BUTTON_GUI
};

enum GUIState
{
	BASIC_STATE,
	ROLL_OVER_STATE,
	CLICK_STATE
};

class GUIBase
{
public:
	GUIBase();
	virtual ~GUIBase();

public:
	virtual BOOL LoadFromXML( XmlNode * guiNode ) { return TRUE; }

	virtual void Update( float fTimeDelta ) {};
	virtual void Render() {};

	virtual BOOL HandleEvent( UINT message, WPARAM wParam, LPARAM lParam ) { return FALSE; }

public:
	void SetID( std::string id )	{ m_ID = id; }
	const std::string GetID()	{ return m_ID; }

	void SetEnable( BOOL bEnable )	{ m_Enable = bEnable; }
	BOOL GetEnable()	{ return m_Enable; }
	
	void SetVisible( BOOL bVisible )	{ m_Visible = bVisible; }
	BOOL GetVisible()	{ return m_Visible; }

	void SetFocus( BOOL focus )	{ m_Focus = focus; }
	BOOL GetFocus()	{ return m_Focus; }

protected:
	BOOL CheckCollision( float x, float y );

protected:
	std::string m_ID;

	GUIType m_type;

	BOOL m_Enable;
	BOOL m_Visible;
	BOOL m_Focus;

	Rect m_rect;

	GUIState m_state;
};
